package com.ukao.pad.ui.writeVipCard;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ukao.pad.R;
import com.ukao.pad.base.BaseFragment;
import com.ukao.pad.widget.ClearEditText;
import com.ukao.pad.widget.StateImageView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link WriteVipCardFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class WriteVipCardFragment extends BaseFragment {


    @BindView(R.id.search_edit_text)
    ClearEditText searchEditText;
    @BindView(R.id.search_button)
    StateImageView searchButton;
    Unbinder unbinder;
    private String mParam2;
    private String mParam1;

    public static WriteVipCardFragment newInstance(String param1, String param2) {
        WriteVipCardFragment fragment = new WriteVipCardFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
    }

    @Override
    protected void initView() {

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_write_vip_card, container, false);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({ R.id.search_button})
    public void onViewClicked(View view) {
        switch (view.getId()) {

            case R.id.search_button:
                String  strsearchEditText=getText(searchEditText);
                if (strsearchEditText.isEmpty())return;
                start(GeneralCardFragment.newInstance("",""));

                break;
        }
    }
}
